import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 *It moves from roght to left after it's has been added to the world
 * 
 * @author Manuel Nava
 * @version 1.0
 */
public class Fire extends Trap
{
    
    /**
     * Calls the method move from the superclass, the method indMove from this class and checks
     * his position in the world and calls the method disapear from this class in a certain position.
     */
    public void act() 
    {
        super.move();
        indMove();
        if(getX()<-800)
          disapear();
    }  
    
    /**
     * Removes the object from the world using the method removeObject from the class World.
       */
    public void disapear()
    {
        getWorld().removeObject(this);
    }
    
    /**
     * Moves the object forward his left.
       */
    public void indMove()
    {
        setLocation(getX()-5,getY());
    }
}
